package nowcoder.day_48.day5;

import java.util.Scanner;

/**
 * WY18 统计回文
 */
public class Num1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1 = in.nextLine();
        String s2 = in.nextLine();
        int count = 0;
        for (int i = 0; i <= s1.length(); i++) {
            StringBuilder sb = new StringBuilder(s1);
            sb.insert(i , s2);
            StringBuilder tmp = new StringBuilder(sb);
            StringBuilder sss = tmp.reverse();
            if (sb.toString().equals(sss.toString())){
                count++;
            }
        }
        System.out.println(count);

    }
}
